package com.alavente.init;

import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import com.alavente.objects.Categorie;
import com.alavente.service.CategoriesManager;

/**
 * Servlet implementation class InitServlet
 */
public class InitServlet extends HttpServlet {
	
	private static final long serialVersionUID = 1L;
	
	@Override
	public void init() throws ServletException {
		super.init();
		List<Categorie> categories = new CategoriesManager().getCategorie();
		getServletContext().setAttribute("categories", categories);
	}
	
	/**
     * @see HttpServlet#HttpServlet()
     */
    public InitServlet() {
        super();
    }
}
